/**
 * 
 */
package com.google.code.cisx.web;

import net.sourceforge.stripes.action.ActionBeanContext;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.action.UrlBinding;

import com.google.code.cisx.model.project.Project;

/**
 * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
 * @version $Id: ManageProjectActionBean.java 259 2008-11-29 13:18:52Z rahul.thakur.xdev $
 * @since 1.0
 */
@UrlBinding("/ManageProjectEntity.action")
public class ManageProjectActionBean extends ManageEntityActionBean<Project> {

  @Override
  protected Class<Project> getEntityClass() {
    return Project.class;
  }

  @Override
  public Class<?> getActionBeanClass() {
    return null;
  }

  @Override
  protected Resolution getResolution(ActionBeanContext context) {
    boolean hasErrors = context.getValidationErrors().size() > 0;
    // TODO: Option to forward to a different resource in case of errors
    if (hasErrors)
      return new ForwardResolution("/projectEdit.jsp");
    else
      return new ForwardResolution("/projectEdit.jsp");
  }

  @Override
  protected void validate() {
    // TODO Auto-generated method stub

  }

}
